package com.tjbklx1.pattern.factory.demo2;

import org.junit.Test;

public class App {

	@Test
	public void test1() {
		Creator creator = new ConCreator();
		Product p = creator.createProduct(ConcreateProduct1.class);
		p.method2();
		System.out.println("========================");
	}
	
	@Test
	public void test2() throws Exception {
		Product p1 = ProductFactory.createProduct("Product1");
		p1.method1();
		p1.method2();
		
		System.out.println("========================");
		
		Product p2 = ProductFactory.createProduct("Product2");
		p2.method1();
		p2.method2();
	}
}
